const user = {
  namespaced: true,
  state: {
    token: '',
    userInfo: null
  },
  mutations: {
    SET_TOKEN: (state, token) => {
      state.token = token
    },
    SET_USER_INFO: (state, userInfo) => {
      state.userInfo = userInfo
    }
  },
  actions: {
    setTokenAction({ commit }, token) {
      commit('SET_TOKEN', token)
    },

    setUserInfoAction({ commit }, userInfo) {
      commit('SET_USER_INFO', userInfo)
    }
  }
}

export default user
